//
//  BaseMode.m
//  dataGathering
//
//  Created by apple on 14/12/22.
//  Copyright (c) 2014年 shuili. All rights reserved.
//

#import "BaseMode.h"

@implementation BaseMode

-(instancetype)initWithMapview :(AGSMapView*)mapview
{
    self = [super init];
    if(self){
        _mapview = mapview;
        if(_mapview){
            _mapview.touchDelegate = self;
            _myGraphicsLayer = [AGSGraphicsLayer graphicsLayer];
            [_mapview addMapLayer:_myGraphicsLayer withName:@"HANDDRAWINGLAYER"];
            
            _innerSymbol = [AGSSimpleFillSymbol simpleFillSymbol];
            _innerSymbol.color = [[UIColor blueColor] colorWithAlphaComponent:0.80];
            _innerSymbol.outline.color = [UIColor darkGrayColor];
            
            AGSSpatialReference *spatialRef = [AGSSpatialReference spatialReferenceWithWKID:4490];
            _myPolygon = [[AGSMutablePolygon alloc] initWithSpatialReference:spatialRef];
            [_myPolygon addRingToPolygon];
            
            _myPolyline = [[AGSMutablePolyline alloc] initWithSpatialReference:spatialRef];
            [_myPolyline addPathToPolyline];
            
            _myPoint = [[AGSMutablePoint alloc] initWithSpatialReference:spatialRef];
            
            
            _mapview.allowCallout = NO;
        }
    }
    return self;
}

-(void)stop
{
    _mapview.touchDelegate = nil;
    _mapview.allowCallout = YES;
}

@end
